package com.hwadee.service.impl;


import com.hwadee.mapper.ElderUserMapper;
import com.hwadee.pojo.ElderUser;
import com.hwadee.service.ElderUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ElderUserServiceImpl implements ElderUserService {

    @Autowired
    private ElderUserMapper elderUserMapper;
    //根据用户名和手机号模糊查询老年用户列表
    public List<ElderUser> searchUsers(String username, String phone){
        return elderUserMapper.findByCondition(username, phone);
    }
    //更新老年用户信息
    @Override
    public void updateUser(ElderUser user) {
        elderUserMapper.update(user);
    }
    //根据 ID 删除老年用户
    @Override
    public void deleteUserById(Integer id) {
        elderUserMapper.deleteById(id);
    }
}
